package com.woniuxy.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/2 0002-下午 1:07
 */
@RestController
public class RedisController {
    @Autowired
    RedisTemplate<String,Object> redisTemplate;
   @RequestMapping("/set")
    public String set(){
       ValueOperations forvalue = redisTemplate.opsForValue();
       forvalue.set("code","123456");//修改数据
       System.out.println(forvalue.get("code"));
       return "success";
    }
}
